<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="text" id="open1">
    <button>点我判断</button>
    <input type="text" id="open2">
    <script>
        var opens1 = document.querySelector('#open1')
        var opens2 = document.querySelector('#open2')
        var oBtn = document.querySelector('button')
        oBtn.onclick = function () {
            // if (isNaN(opens1.value)) {
            //     opens2='不是数字'
            // } else  {
            //     opens2='是数字'
            // } 
            if (opens1.value.trim() == '') {//检测是否为空
                alert('请输入内容');
                return;
            }
            if (isNaN(opens1.value)) {
                return alert('请输入数字')
            }
            if (opens1.value % 3 == 0) {//判断是否为3的倍数的条件
                opens2.value = '是3的倍数'

            } else {
                opens2.value = '不是3的倍数'
            }

        }
    </script>
</body>

</html>